package com.sl.biz.modular.ai.controller;

import com.sl.biz.modular.ai.dao.domain.entity.AiChatHistoryDO;
import com.sl.biz.modular.ai.service.AiChatHistoryBizService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ai/chat/history")
@RequiredArgsConstructor
public class AiChatHistoryController {


    private final AiChatHistoryBizService aiChatHistoryBizService;

    @PostMapping("/save")
    public Boolean save(@RequestBody AiChatHistoryDO aiChatHistoryDO) {
        return aiChatHistoryBizService.save(aiChatHistoryDO);
    }
    @PostMapping("/get_by_ai_chat_id")
    public List<AiChatHistoryDO> getByAiChatId(@RequestBody AiChatHistoryDO aiChatHistoryDO) {
        return aiChatHistoryBizService.getByAiChatId(aiChatHistoryDO);
    }

    @PostMapping("/batch_save")
    public Boolean batchSave(@RequestBody List<AiChatHistoryDO> chatHistoryList) {
        return aiChatHistoryBizService.batchSave(chatHistoryList);
    }
    @PostMapping("/clear_history")
    public Boolean clearHistory(@RequestBody AiChatHistoryDO aiChatHistoryDO) {
        return aiChatHistoryBizService.clearHistory(aiChatHistoryDO);
    }





}
